package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.admin.vo.HeaderFieldsVO;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.ChildCompanyAddDTO;
import org.jsola.hr.dto.ChildCompanyUpdateDTO;
import org.jsola.hr.query.ChildCompanyQuery;
import org.jsola.hr.query.HrEmployeeSalaryNewQuery;
import org.jsola.hr.query.HrEmployeeSalaryQuery;
import org.jsola.hr.query.HrMonthlySalaryQuery;
import org.jsola.hr.vo.*;
import org.jsola.salary.vo.EmployeeDetailsNewVO;
import org.jsola.salary.vo.EmployeeDetailsVO;
import org.jsola.salary.vo.SalaryTemplateItemVO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;

import java.util.List;

/**
 * 用工单位分组
 *
 * @author zhr
 */
@Api(tags = "hr-用工单位分组")
public interface IChildCompanyControllerAPI {

    /**
     * 根据用工单位分组id查询用工单位分组详情
     *
     * @param childCompanyId 用工单位分组id
     * @return 用工单位分组详情
     */
    @ApiOperation(value = "根据用工单位分组id查询用工单位分组详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyId", dataType = "String", value = "用工单位分组id", paramType = "path")
    })
    Result<ChildCompanyVO> findById(String childCompanyId);

    /**
     * 根据子公司信息id查询子公司信息详情
     *
     * @param childCompanyId 子公司信息id
     * @return 子公司信息详情
     */
    @ApiOperation(value = "根据子公司信息id查询子公司信息详情及关联信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyId", dataType = "String", value = "子公司信息id", paramType = "path")
    })
    Result<ChildCompanyVO> findChildAndRelationById(String childCompanyId);


    /**
     * 查询用工单位分组
     *
     * @param childCompanyQuery 用工单位分组查询参数
     * @return page
     */
    @ApiOperation(value = "查询用工单位分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyQuery", dataType = "ChildCompanyQuery", value = "用工单位分组查询参数", paramType = "query")
    })
    Result<List<ChildCompanyListVO>> listAll(ChildCompanyQuery childCompanyQuery);

    /**
     * 查询用工单位分组(结果过滤且结构变为list)
     *
     * @param childCompanyQuery 用工单位分组查询参数
     * @return page
     */
    @ApiOperation(value = "查询用工单位分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyQuery", dataType = "ChildCompanyQuery", value = "用工单位分组查询参数", paramType = "query")
    })
    Result<List<ChildCompanyListVO>> listAllList(ChildCompanyQuery childCompanyQuery);


    /**
     * 分页查询用工单位分组
     *
     * @param childCompanyQuery 用工单位分组查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询用工单位分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyQuery", dataType = "ChildCompanyQuery", value = "用工单位分组查询参数", paramType = "query")
    })
    Result<Page<ChildCompanyListVO>> page(ChildCompanyQuery childCompanyQuery);

    @ApiOperation(value = "用工单位-查询树形")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyQuery", dataType = "ChildCompanyQuery", value = "用工单位分组查询参数", paramType = "query")
    })
    Result<List<ChildCompanyVO>> tree(ChildCompanyQuery childCompanyQuery);


    /**
     * 新增子公司信息
     *
     * @param childCompanyAddDTO 子公司信息新增实体
     * @return 子公司信息展示对象
     */
    @ApiOperation(value = "新增子公司信息及子公司关联信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyAddDTO", dataType = "ChildCompanyAddDTO", value = "新增子公司信息", paramType = "body")
    })
    Result<ChildCompanyVO> saveChildAndRelation(ChildCompanyAddDTO childCompanyAddDTO);


    /**
     * 修改子公司信息
     *
     * @param childCompanyUpdateDTO 子公司信息
     * @return 更新数量
     */
    @ApiOperation(value = "修改子公司信息及子公司关联信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyUpdateDTO", dataType = "ChildCompanyUpdateDTO", value = "修改子公司信息", paramType = "body")
    })
    Result<Integer> updateChildAndRelation(ChildCompanyUpdateDTO childCompanyUpdateDTO);

    /**
     * 删除单个子公司信息，彻底删除
     *
     * @param childCompanyId 子公司信息id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个子公司信息及子公司关联信息，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyId", dataType = "String", value = "子公司信息id", paramType = "path")
    })
    Result<Integer> deleteChildAndRelation(String childCompanyId);


    /**
     * 查询用户有的权限的用工单位
     *
     * @param userId 用户Id
     * @return 用户有的权限的用工单位
     */
    @ApiOperation(value = "查询用户有的权限的用工单位")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", dataType = "String", value = "用户Id", paramType = "query")
    })
    Result<UserCompanyVO> selectByUserId(String userId);

    /**
     * 查询用工单位的客户明细
     *
     * @param hrMonthlySalaryQuery 用工单位查询
     * @return 用工单位的客户明细
     */
    @ApiOperation(value = "查询用户有的权限的用工单位")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "hrMonthlySalaryQuery", dataType = "HrMonthlySalaryQuery", value = "用工单位查询", paramType = "body")
    })
    Result<List<HrMonthlySalarySummaryVO>> selectMonthlySalaryByCompanyList(HrMonthlySalaryQuery hrMonthlySalaryQuery);



    /**
     * 查询用工单位/分组的表头
     *
     * @param type 类型：用工单位/分组
     * @param id   Id
     * @return 表头信息
     */
    @ApiOperation(value = "查询用工单位/分组的表头")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "yearly", dataType = "Integer", value = "年", paramType = "query"),
            @ApiImplicitParam(name = "monthly", dataType = "Integer", value = "月", paramType = "query"),
            @ApiImplicitParam(name = "type", dataType = "String", value = "类型", paramType = "query"),
            @ApiImplicitParam(name = "id", dataType = "String", value = "Id", paramType = "query")
    })
    Result<List<SalaryTemplateItemVO>> selectUsedTemplateByCompanyList(Integer yearly, Integer monthly
            , String type, String id);

    /**
     * 查询员工的客户明细
     *
     * @param hrEmployeeSalaryQuery 查询条件
     * @return 员工的客户明细
     */
    @ApiOperation(value = "查询员工的客户明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "hrEmployeeSalaryQuery", dataType = "HrEmployeeSalaryQuery", value = "查询条件", paramType = "query")
    })
    Result<Page<EmployeeDetailsVO>> selectEmployeeSalaryByCompanyIds(HrEmployeeSalaryQuery hrEmployeeSalaryQuery);


    /**
     * 客户明细表导出
     *
     * @param hrEmployeeSalaryQuery 导出动态参数
     * @return excel
     */
    @ApiOperation(value = "客户明细表导出excel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "hrEmployeeSalaryQuery", dataType = "HrEmployeeSalaryQuery", value = "导出动态参数", paramType = "body")
    })
    ResponseEntity<Resource> export(HrEmployeeSalaryQuery hrEmployeeSalaryQuery);


    /**
     * 查询客户明细表头
     *
     * @param hrEmployeeSalaryQuery 导出动态参数
     * @return 客户明细表头
     */
    @ApiOperation(value = "查询客户明细表头")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "hrEmployeeSalaryQuery", dataType = "HrEmployeeSalaryQuery", value = "导出动态参数", paramType = "body")
    })
    Result<HeaderFieldsVO> selectHeaderDetail(HrEmployeeSalaryQuery hrEmployeeSalaryQuery);


}

